using System.ComponentModel;

namespace SumerCoreDevOps.Application.Dtos.Requests.Roles
{
    /// <summary>
    /// 创建角色请求
    /// </summary>
    public class CreateRoleRequest
    {
        /// <summary>
        /// 角色名称
        /// </summary>
        /// <example>Developer</example>
        [Description("角色名称")]
        public string RoleName { get; set; } = null!;

        /// <summary>
        /// 角色描述
        /// </summary>
        /// <example>开发人员角色</example>
        [Description("角色描述")]
        public string? Description { get; set; }

        /// <summary>
        /// 创建者
        /// </summary>
        /// <example>admin</example>
        [Description("创建者")]
        public string? CreatedBy { get; set; }
    }

    /// <summary>
    /// 分配权限请求
    /// </summary>
    public class AssignPermissionsRequest
    {
        /// <summary>
        /// 权限ID列表
        /// </summary>
        /// <example>[1, 2, 3]</example>
        [Description("权限ID列表")]
        public List<long> PermissionIds { get; set; } = new();

        /// <summary>
        /// 操作者
        /// </summary>
        /// <example>admin</example>
        [Description("操作者")]
        public string? OperatedBy { get; set; }
    }

    /// <summary>
    /// 为用户分配角色请求
    /// </summary>
    public class AssignRoleToUserRequest
    {
        /// <summary>
        /// 用户ID
        /// </summary>
        /// <example>1</example>
        [Description("用户ID")]
        public long UserId { get; set; }

        /// <summary>
        /// 角色ID
        /// </summary>
        /// <example>2</example>
        [Description("角色ID")]
        public long RoleId { get; set; }

        /// <summary>
        /// 操作者
        /// </summary>
        /// <example>admin</example>
        [Description("操作者")]
        public string? OperatedBy { get; set; }
    }

    /// <summary>
    /// 从用户移除角色请求
    /// </summary>
    public class RevokeRoleFromUserRequest
    {
        /// <summary>
        /// 用户ID
        /// </summary>
        /// <example>1</example>
        [Description("用户ID")]
        public long UserId { get; set; }

        /// <summary>
        /// 角色ID
        /// </summary>
        /// <example>2</example>
        [Description("角色ID")]
        public long RoleId { get; set; }

        /// <summary>
        /// 操作者
        /// </summary>
        /// <example>admin</example>
        [Description("操作者")]
        public string? OperatedBy { get; set; }
    }
}
